
*** Do-File ***
*** Terror After the Caliphate: The Effect of ISIS Loss of Control over Population Centers on Patterns of Global Terrorism
*** Security Studies


*** James A. Piazza, Department of Politcal Science, The Pennsylvania State University (corresponding author, jap45@psu.edu)
*** Michael J. Soules, Department of Politcal Science, The Pennsylvania State University




*** Table 1.  Main Results, Effects of ISIS Loss of Cities/Population Centers on Internationalization of Attacks

* 1.  Attacks Abroad by ISIS Core [H1]
nbreg isis_core_attack_abroad cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)

* 2.  Ratio Attacks Abroad by ISIS Core [H1]
tobit ratio_isis_core_abroad2 cities_loss_daily_cum production_isis_imputed isis_killed, nolog ll(0) ul(3) cluster(month_number)

* 3.  Attacks Abroad by ISIS Affiliates [H1]
nbreg isis_affil_attack cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)

* 4.  Attacks Abroad against Interveners [H2]
nbreg intervener cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)

* 5.  Attacks Abroad in Countries with Religious Hostilities [H2]
nbreg attack_veryhigh_relhostility cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)

* 6.  Attacks Abroad against Countries with Returning Foreign Fighters [H2]
nbreg ff_return_country cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)

* 7.  Casualties Abroad by ISIS Core [H3]
nbreg isis_core_abroad_casualties cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)



*** Table 2.  Marginal Effects of ISIS Loss of Cities/Population Centers on Predicted Number of Attacks per Day

* Note, we do not report full model results.  We only report the substantive effect (for whole model) of holding IV at 0, 6, 12 on DVs

* Core Attack Abroad     
nbreg isis_core_attack_abroad cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)
mfx compute, at(mean)
mfx compute, at(mean cities_loss_daily_cum=0)
mfx compute, at(mean cities_loss_daily_cum=6)
mfx compute, at(mean cities_loss_daily_cum=12)

* Ratio Core Attack Abroad       
tobit ratio_isis_core_abroad2 cities_loss_daily_cum production_isis_imputed isis_killed, nolog ll(0) ul(3) cluster(month_number)
mfx compute, at(mean)
mfx compute, at(mean cities_loss_daily_cum=0)
mfx compute, at(mean cities_loss_daily_cum=6)
mfx compute, at(mean cities_loss_daily_cum=12)

* Affiliate Attack Abroad     
nbreg isis_affil_attack cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)
mfx compute, at(mean)
mfx compute, at(mean cities_loss_daily_cum=0)
mfx compute, at(mean cities_loss_daily_cum=6)
mfx compute, at(mean cities_loss_daily_cum=12)

* Core Attack Interveners     
nbreg intervener cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)
mfx compute, at(mean)
mfx compute, at(mean cities_loss_daily_cum=0)
mfx compute, at(mean cities_loss_daily_cum=6)
mfx compute, at(mean cities_loss_daily_cum=12)

* Core Attack Rel Hostility     
nbreg attack_veryhigh_relhostility cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)
mfx compute, at(mean)
mfx compute, at(mean cities_loss_daily_cum=0)
mfx compute, at(mean cities_loss_daily_cum=6)
mfx compute, at(mean cities_loss_daily_cum=12)

* Core Attack FF Countries     
nbreg ff_return_country cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)
mfx compute, at(mean)
mfx compute, at(mean cities_loss_daily_cum=0)
mfx compute, at(mean cities_loss_daily_cum=6)
mfx compute, at(mean cities_loss_daily_cum=12)

* Core Casualties Abroad     
nbreg isis_core_abroad_casualties cities_loss_daily_cum production_isis_imputed isis_killed, nolog cluster(month_number)
mfx compute, at(mean)
mfx compute, at(mean cities_loss_daily_cum=0)
mfx compute, at(mean cities_loss_daily_cum=6)
mfx compute, at(mean cities_loss_daily_cum=12)


*** Table 3.  Summary of Impact of Time-Lagged Loss of Cities/Population Centers on ISIS Internationalization of Attacks
* Checks using lags.  7, 30, 90, 180, 365 days

* Creating lags
gen lag_week_cumcities=0
replace lag_week_cumcities=cities_loss_daily_cum[_n-7]

gen lag_month_cumcities=0
replace lag_month_cumcities=cities_loss_daily_cum[_n-30]

gen lag_threemonth_cumcities=0
replace lag_threemonth_cumcities=cities_loss_daily_cum[_n-90]

gen lag_sixmonth_cumcities=0
replace lag_sixmonth_cumcities=cities_loss_daily_cum[_n-180]

gen lag_year_cumcities=0
replace lag_year_cumcities=cities_loss_daily_cum[_n-365]


* Models
* Note we only report coefficients, not full model results

nbreg isis_core_attack_abroad   	lag_week_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)
tobit ratio_isis_core_abroad2    	lag_week_cumcities      production_isis_imputed isis_killed, nolog ll(0) ul(3) cluster(month_number)
nbreg isis_affil_attack     		lag_week_cumcities         production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg intervener         			lag_week_cumcities        production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg attack_veryhigh_relhostility  lag_week_cumcities     production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg ff_return_country        		lag_week_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg isis_core_abroad_casualties   lag_week_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)

nbreg isis_core_attack_abroad   	lag_month_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)
tobit ratio_isis_core_abroad2    	lag_month_cumcities      production_isis_imputed isis_killed, nolog ll(0) ul(3) cluster(month_number)
nbreg isis_affil_attack     		lag_month_cumcities         production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg intervener         			lag_month_cumcities        production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg attack_veryhigh_relhostility  lag_month_cumcities     production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg ff_return_country        		lag_month_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg isis_core_abroad_casualties   lag_month_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)


nbreg isis_core_attack_abroad   	lag_threemonth_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)
tobit ratio_isis_core_abroad2    	lag_threemonth_cumcities      production_isis_imputed isis_killed, nolog ll(0) ul(3) cluster(month_number)
nbreg isis_affil_attack     		lag_threemonth_cumcities         production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg intervener         			lag_threemonth_cumcities        production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg attack_veryhigh_relhostility  lag_threemonth_cumcities     production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg ff_return_country        		lag_threemonth_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg isis_core_abroad_casualties   lag_threemonth_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)

nbreg isis_core_attack_abroad   	lag_sixmonth_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)
tobit ratio_isis_core_abroad2    	lag_sixmonth_cumcities      production_isis_imputed isis_killed, nolog ll(0) ul(3) cluster(month_number)
nbreg isis_affil_attack     		lag_sixmonth_cumcities         production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg intervener         			lag_sixmonth_cumcities        production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg attack_veryhigh_relhostility  lag_sixmonth_cumcities     production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg ff_return_country        		lag_sixmonth_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg isis_core_abroad_casualties   lag_sixmonth_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)

nbreg isis_core_attack_abroad   	lag_year_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)
tobit ratio_isis_core_abroad2    	lag_year_cumcities      production_isis_imputed isis_killed, nolog ll(0) ul(3) cluster(month_number)
nbreg isis_affil_attack     		lag_year_cumcities         production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg intervener         			lag_year_cumcities        production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg attack_veryhigh_relhostility  lag_year_cumcities     production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg ff_return_country        		lag_year_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)
nbreg isis_core_abroad_casualties   lag_year_cumcities       production_isis_imputed isis_killed, nolog cluster(month_number)



drop lag_week_cumcities lag_month_cumcities lag_threemonth_cumcities lag_sixmonth_cumcities lag_year_cumcities





****** Appendix ***




*** Table Appendix 3. Descriptive Statistics
sum isis_core_attack_abroad ratio_isis_core_abroad2 isis_affil_attack intervener attack_veryhigh_relhostility ff_return_country isis_core_abroad_casualties cities_loss_daily_cum production_isis_imputed isis_killed



*** Appendix Figures 1-7

** Response to Editor - report and graph bivariate tests (put in appendix)
* Bivariate Tests
pwcorr isis_core_attack_abroad cities_loss_daily_cum, sig
pwcorr ratio_isis_core_abroad2 cities_loss_daily_cum, sig
pwcorr isis_affil_attack cities_loss_daily_cum, sig
pwcorr intervener cities_loss_daily_cum, sig
pwcorr attack_veryhigh_relhostility cities_loss_daily_cum, sig
pwcorr ff_return_country cities_loss_daily_cum, sig
pwcorr isis_core_abroad_casualties cities_loss_daily_cum, sig

* Graphing Bivariate Tests
graph twoway (lfitci isis_core_attack_abroad cities_loss_daily_cum)
graph twoway (lfitci ratio_isis_core_abroad2 cities_loss_daily_cum)
graph twoway (lfitci isis_affil_attack cities_loss_daily_cum)
graph twoway (lfitci intervener cities_loss_daily_cum)
graph twoway (lfitci attack_veryhigh_relhostility cities_loss_daily_cum)
graph twoway (lfitci ff_return_country cities_loss_daily_cum)
graph twoway (lfitci isis_core_abroad_casualties cities_loss_daily_cum)








*** Appendix Table 5. Endogeneity Tests



* 1.  Core attacks abroad [H1]
ivregress 2sls isis_core_attack_abroad production_isis_imputed isis_killed  (cities_loss_daily_cum=avg_hdi)
estat endog

* 2.  Ratio of core attacks abroad [H1]
ivregress 2sls ratio_isis_core_abroad2 production_isis_imputed isis_killed  (cities_loss_daily_cum=avg_hdi)
estat endog

* 3.  Affiliate attacks abroad [H1]
ivregress 2sls isis_affil_attack production_isis_imputed isis_killed  (cities_loss_daily_cum=avg_hdi)
estat endog

* 4.  Core attacks against interveners [H2]
ivregress 2sls intervener production_isis_imputed isis_killed  (cities_loss_daily_cum=avg_hdi)
estat endog

* 5.  Core attacks abroad in countries experiencing religious hostilities [H2]
ivregress 2sls attack_veryhigh_relhostility production_isis_imputed isis_killed  (cities_loss_daily_cum=avg_hdi)
estat endog

* 6.  Core and affiliate attacks in countries where foreign fighters are returning [H2]
ivregress 2sls ff_return_country production_isis_imputed isis_killed  (cities_loss_daily_cum=avg_hdi)
estat endog

* 7.  Core casualties abroad [H3]
ivregress 2sls isis_core_abroad_casualties production_isis_imputed isis_killed  (cities_loss_daily_cum=avg_hdi)
estat endog




